home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / wb / DosMan121.lha / man / Ask < prev    next >
Text File  |  1995-05-05  |  2KB  |  55 lines

  1.  
  2.  
  3.  
  4.                     Ask(V1.3 in C:) (v 2.x & 3.x internal)
  5.  
  6.  
  7.  
  8.      NAME
  9.           Ask - Query user interactively.
  10.  
  11.      SYNOPSIS
  12.           Ask Prompt WARN OK TIMEOUT
  13.  
  14.      DESCRIPTION
  15.             Ask is a program that allows you to get a simple form 
  16.         of input from a user.  It is most useful in Execute 
  17.         scripts.
  18.  
  19.             You may specify a Prompt string, which will be 
  20.         displayed to the user, and you may also specify a string 
  21.         to match on for both YES and NO responses, as well as 
  22.         specifying a time limit on the users response in seconds.  
  23.         All of these strings have default values, the default for 
  24.         the WARN string is 'Y', the default for the OK string is 
  25.         'N', and the default for the Prompt is a single question 
  26.         mark.
  27.  
  28.             If the user enters a string which matches the WARN 
  29.         string, Ask will exit with a return code that will cause 
  30.         an IF WARN statement to succeed.  If the user enters a 
  31.         string which matches the OK string, exceeds the value 
  32.         given in TIMEOUT, or simply hits RETURN then Ask will 
  33.         exit with a ZERO return, suitable for the ELSE portion of 
  34.         such an IF statement.
  35.  
  36.             More simply: A 'yes' returns a 5. A 'no' returns a 0.
  37.  
  38.             If the user enters a string other than those 
  39.         specified in WARN and OK, then ASK will redisplay the 
  40.         prompt, urging the user to give a better answer.
  41.  
  42.      EXAMPLE
  43.             Here is an example of an Ask command which will 
  44.         return a WARNING if the user types "Amiga", and an OK if 
  45.         the user types "BigBlue", or waits longer than 10 seconds 
  46.         to respond:
  47.  
  48.           Ask "Amiga or BigBlue?" "Amiga" "BigBlue" Timeout 10
  49.           IF WARN  ; typed amiga!
  50.           Echo "Obviously a person of quality"
  51.           ELSE ; typed big blue? or couldn't decide
  52.           Echo "You seem to be misguided"
  53.           ENDIF
  54.  
  55.